package com.neusoft.elmboot.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.neusoft.elmboot.po.WalletExc;

@Mapper
public interface WalletExcMapper {

   Logger logger = LoggerFactory.getLogger(WalletExcMapper.class);

    @Insert("insert into walletExc(excTime, excMoney, excType, excInUserId, excOutUserId) " +
            "values(#{excTime}, #{excMoney}, #{excType}, #{excInUserId}, #{excOutUserId})")
    @Options(useGeneratedKeys = true, keyProperty = "excId", keyColumn = "excId")
    public int saveWalletExc(WalletExc walletExc);

    default void logError(Exception e) {
        logger.error("Error occurred while saving wallet transaction", e);
    }
}